<div data-page="<{$pageName}>" class="page" style="background-color:#fff; ">
    <div class="page-content">
        <style>
        .block_div {
            padding: 10px;
            background-color: #fff;
            margin-top: 10px;
            border-bottom: 1px solid #EAEAEA
        }
        
        .light {
            color: #A0A0A0
        }
        
        .cart_item .row {}
        
        .buy_select {
            color: #337ab7;
            background-color: #fff;
            margin-top: 10px;
        }
        
        .block_div .col-xs-2 {
            padding: 0px;
        }
        
        .block_div .row {
            margin-right: 0px
        }
        .block_div_on ,.block_div_on .light{color:#337ab7}
        </style>
        <input type="hidden" id="goods_amount" value="<{$subject_info.price}>" />
        <img style="max-width:100%" src="__Img__/<{$subject_info.picname}>@475h_800w_1e_0c" />
        <div class="block_div" style="background-color:#fff; margin-top:0px">
            <div class="cart_item">
                <!--x课程-->
                <div class="row">
                    <div class="col-sm-6">
                        <h4> <{$subject_info.subject}> </h4>
                        <div class="course_price mgt10">
                            <span class="nav-price"><span class="f24 red">￥</span>
                            <{$subject_info.price}>
                                </span><span class="muted f14 ">&nbsp;&nbsp;&nbsp;(共有 <{$buy_count}> 名学员)</span>
                        </div>
                        <div class="muted mgt10">
                            <{$subject_info.class_hours}>课时 <span class="muted light">/</span> 报名即学 至
                                <{$subject_info.end_date}>
                        </div>
                    </div>
                </div>
                <!--x线下班级-->
                <if condition="$offline_subject['offline'] gt 1">
                    <div class="row <if condition=" $select_offline eq 3 ">buy_select
																				</if>
																				" id="buy_select_offline_fee" <if condition="$offline_subject['offline'] eq 2">onclick="add_buy(this)"</if>
                style="padding:10px 0px; cursor:pointer" price="
                <{$offline_subject.price}>">
                    <div class="col-xs-9">
                        <p> &nbsp;&nbsp;<span class="glyphicon  glyphicon-ok"></span>&nbsp;&nbsp;选下班级（
                            <{$user_info.school.name}>）</p>
                        <p class="light">你所在的学校有线下班级，购买课程后可以在线选座位，随到随学</p>
                    </div>
                    <div class="col-xs-2 s_right" style="text-align:right; float:right">+
                        <{$offline_subject.price}>元</div>
                    </div>
                    </if>
                    <!--x在线报名-->
                    <if condition="$offline_subject['apply'] gt 1">
                        <div class="row <if condition=" $select_apply eq 3 ">buy_select
																				</if>
																				" id="buy_select_examination_fee" <if condition="$offline_subject['apply'] eq 2">onclick="add_buy(this)"</if>
                    style="padding:10px 0px;cursor:pointer" price="
                    <{$offline_subject.examination_fee}>" >
                        <div class="col-xs-9">
                            <p> &nbsp;&nbsp;<span class="glyphicon  glyphicon-ok"></span>&nbsp;&nbsp;在线报名 (<a data-type="modal" title="确认报名信息" target="registerForExamination" href="<{:U('Index/registerForExamination',array('class_id'=>$subject_info['subject_class'],'subjectid'=>$subject_info['subjectid']))}>">查看报名信息</a>)</p>
                            <p class="light">在线报名费用是用于考试费用，教育部门授权代收，全国统一价</p>
                            <input type="hidden" value="0" id="examination_id" />
                        </div>
                        <div class="col-xs-2 s_right" style="text-align:right; float:right">+
                            <{$offline_subject.examination_fee}>元</div>
                        </div>
                        </if>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="block_div" <if condition="$user_info['money'] elt 0">style="display:none"</if>
            >
            <div class="form-group" style="margin-bottom:0px; margin-left:-15px">
                <div class="col-sm-12 control-label show_input" onclick="show_input(this)" for="formGroupInputLarge"> <span class="glyphicon glyphicon-credit-card" aria-hidden="true" style="color:#337ab7"></span>
                    <font >学币支付</font><span class="light"> (可用余额:￥<{$user_info['money']}>)</span></div>
                <div class="col-sm-12" style="display:none;margin:5px;">
                    <input class="form-control" type="text" id="yie" max="<{$user_info['money']}>" onblur="check_yie(this)" placeholder="输入使用学币">
                </div>
            </div>
            <div class="clearfix"></div>
        </div>

         <div class="block_div" id="use_study_card_div" onclick="use_study_card(this)"  <if condition="$study_card eq 0">style="display:none"</if>
            >
            <div class="form-group " style="margin-bottom:0px; margin-left:-15px">
                <div class="col-sm-12 control-label show_input" for="formGroupInputLarge"> 
                <span class="glyphicon glyphicon-barcode" aria-hidden="true" style="color:#337ab7"></span>
                <font >学习卡</font><span class="light"> (可用:<{:count($study_card)}>张)</span>
                <font  class="s_right light">使用学习卡</font>
                <input type="hidden" id="study_card_num" value="<{$study_card[0]['card_code']}>">
                </div>
               
            </div>
            <div class="clearfix"></div>
        </div>

        

        <div class="block_div" style="border:none">
            <div class="form-group" style="margin-bottom:0px;margin-left:-15px">
                <div class="col-sm-12 control-label show_input" onclick="show_input(this)" for="formGroupInputLarge"><span class="icon-icon-46" aria-hidden="true" style="color:#337ab7"></span> 优惠码 <span class="light">(最高可以优惠￥500)</span></div>
                <div class="col-sm-12" style="display:none;margin:5px;">
                    <input class="form-control" type="text" onblur="check_num(this)" value="<{$parent_user.school_num}>" id="school_num" money="0" placeholder="输入优惠码">
                </div>
                <div class="col-sm-12" style="display:none;margin:5px;" id="school_num_text">
                    <font style="color:#337ab7">优惠￥20</font>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
        <!--<div class="block_div">
								<div class="form-group" style="margin-bottom:0px">
												<div class="col-sm-12 control-label show_input" for="formGroupInputLarge">使用优惠口令 </div>
												<div class="col-sm-12" style="display:none;margin:5px;">
																<input class="form-control" type="text" onblur="check_num(this)" id="card_num"  money="0" placeholder="输入优惠口令">
												</div>
												<div class="col-sm-12"  style="display:none; margin:5px;" id="card_num_text"><font style="color:#337ab7">优惠￥20</font></div>
								</div>
								<div class="clearfix"></div>
				</div>-->
        <div style=" height:100px;"></div>
    </div>
    <div class="fixedBottom">
        <div class="form-group" style="padding-right:20px">
            <div class="col-md-4" style="float:right">
                <div align="right"><strong>实际需要支付：</strong><strong class="red f24 red"><span class="order_amount"><{$subject_info.price}></span></strong> 元 <span class="light">(已省￥<font class="save_money">0</font>)</span></div>
                <a data-type="none" style="width:100%; padding:10px" onclick="buy_now()" id="next_btn" class="btn btn-primary border-radius-none mgt10"> 下一步 </a> </div>
        </div>
        <div class="clearfix"></div>
    </div>
    <script>
    var select_offline=<{$offline_subject['offline']|default="0"}>;
	var select_apply=<{$offline_subject['apply']|default="0"}>;
	var buy_type=2;
	var money=<{$user_info['money']|default="0"}>;
	var goods_amount=<{$subject_info.price}>;
	var subjectid=<{$subject_info.subjectid}>;
	var check_url="/Subject/get_card";    
	function show_input(_this){
		$(_this).next().toggle();
	}
    
    $(function() {
        $(".pages").height($(window).height());
        var school_num = $("#school_num");
        if (school_num.val()) {
            $(school_num).parents(".show_input").trigger("click");
            check_num(school_num);
        }

        get_order_amount();
    })
    </script>
</div>
